package ga;

public class WeightScore implements Comparable<WeightScore> {
	public int score = -1;
	public WeightSet ws;
	
	public WeightScore(int score, WeightSet ws) {
		
		this.score = score;
		this.ws = ws;
	}
	
	WeightScore(WeightSet ws) {
		this(0,ws);
	}

	@Override
	public int compareTo(WeightScore o) {
		return score-o.score;
	}
	
	public boolean equals(Object o) {
		int oscore = ((WeightScore)o).score;
		WeightSet ows = ((WeightScore)o).ws;
		
		if ((oscore == score) && (ws.equals(ows)))
			return true;
		
		return false;			
	}
	
	public void setScore(int score) {
		this.score = score;
	}
	
	public String toString() {
		return "score: "+score+"\n"+ws.toString();
	}
}

